<template>
  <el-dialog
    :visible.sync="visible"
    :close-on-click-modal="false"
    :show-close="false"
    :close-on-press-escape="false">
    <el-form>
      <el-input type="text"></el-input>
      <el-input type="password"></el-input>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="logout()">取 消</el-button>
      <el-button type="primary" @click="login()">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "Login",
  data() {
    return {visible: true}
  },
  computed: {},
  mounted: function () {
    this.$root.$login = this;
  },
  methods: {
    login() {
      this.$sessionStore.set("authenticated", true);
      this.visible = false;
    },
    logout() {
      this.$sessionStore.set("authenticated", false);
      this.visible = true;
    }
  }
}
</script>

<style scoped>

</style>
